package com.ht.medicaltreatment.adapter

import android.widget.ImageView
import com.blankj.utilcode.util.LogUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.ht.medicaltreatment.R
import com.ht.medicaltreatment.bean.Drawblood
import com.ht.medicaltreatment.bean.WanDaiBean
import com.xgst.lib.utils.TimeUtils

class MultiSampleCollectionAdapter:BaseQuickAdapter<Drawblood,BaseViewHolder>(R.layout.item_multi_layout) {
    override fun convert(holder: BaseViewHolder, item: Drawblood) {
        val img = holder.getView<ImageView>(R.id.imgTube)

        if(item.scanTime != null){
            holder.setText(R.id.tvTime,"核验时间\n${item.scanTime}")
            img.setBackgroundResource(R.drawable.icon_tube_green)
        }else{
            img.setBackgroundResource(R.drawable.icon_gray_tube)
        }

        if(item.checkSuccess == 1 || item.checkSuccess == 2 || item.checkSuccess == 4){
            img.setBackgroundResource(R.drawable.icon_tube_red)
            holder.setText(R.id.tvTime,"核验时间\n${item.scanTime}")
            LogUtils.i(item.checkSuccess,item.name)
        }
    }
}
